package _5_multithread;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
  public static final ThreadLocal<DateFormat> dateFormat = new ThreadLocal<DateFormat>(){
    @Override
    protected DateFormat initialValue() {
      return new SimpleDateFormat("yyyy-MM-dd");
    }
  };

  public static void main(String[] args) {
    System.out.println(DateUtils.dateFormat.get().format(new Date()));
  }
}
